<template>
  <!-- 排行榜（无图） -->
  <div class="noimg-rank">
    <div class="rank-header">
       <span>排行榜</span>
       <span class="rank-header-more">
         更多
         <i class="el-icon-arrow-right"></i>
       </span>
    </div>
    <div class="rank-list-item" v-for="(item,index) in ranklist" :key="index">
      <span class="rank-item-order" :class="index<=2 ? 'orderActive' : ''">{{index+1}}</span>
      <div class="rank-item-info">
        <span :title="item.name" class="rank-item-title">{{item.name}}</span>
        <span v-if="item.state == 0 && type=='update'" class="rank-item-num">更新至{{item.num}}话</span>
        <span v-if="item.state == 1 && type=='update'" class="rank-item-num">全{{item.num}}话</span>
        <span v-if="type=='movie'" class="rank-item-num">{{item.time}}上映</span>
      </div>
    </div>
  </div>
</template>

<script>
  export default{
    name:'NoImgRank',
    props:{
      type:{
        type:String,
        required:false,
        default:'update'
      },
      ranklist:{
        type:Array,
        required:false,
      }
    },
    data(){
      return{

      }
    }
  }
</script>

<style scoped>
  .noimg-rank{
    width: 320px;
  }
  .rank-header{
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 36px;
    margin-bottom: 16px;
  }
  .rank-header>span:nth-child(1){
    display: inline-block;
    color:#212121;
    vertical-align: bottom;
    font-size: 20px;
    line-height: 28px;
  }
  .rank-header-more{
    display: flex;
    align-items: center;
    width: 58px;
    padding:0 0 0 12px;
    height: 22px;
    border: 1px solid silver;
    border-radius: 2px;
    color:#505050;
    text-align: center;
    font-size: 12px;
    line-height: 16px;
    transition: background-color .2s;
    box-sizing: border-box;
    cursor: pointer;
  }
  .rank-header-more>i{
    vertical-align: middle;
    font-size: 14px;
  }
  .rank-header-more:hover{
    background-color:#f4f4f4;
  }
  .rank-list-item{
    display: flex;
    justify-content: space-between;
    margin-bottom: 18px;
    cursor: pointer;
  }
  .rank-item-order{
    font-size: 14px;
    color:#999;
    width: 18px;
    height:18px;
    text-align: center;
    line-height: 18px;
    border-radius: 2px;
    display: inline-block;
  }
  .orderActive{
    background: #00A1D6;
    color:#fff;
  }
  .rank-item-info{
    width: 290px;
    line-height: 20px;
    display: flex;
    justify-content: space-between;
  }
  .rank-item-title{
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 198px;
    font-size: 14px;
    font-weight: 500;
    color:#212121;
    transition: color .2s;
  }
  .rank-list-item:hover .rank-item-title{
    color:#00A1D6;
  }
  .rank-item-num{
    font-size: 12px;
    color:#999;
    text-align: right;
    min-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
</style>
